<!DOCTYPE html>
<html prefix="
og: http://ogp.me/ns#
article: http://ogp.me/ns/article#
" lang="zh_cn">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>python grpc 使用 | vincent blog</title>
<link href="../../assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
<link rel="alternate" type="application/rss+xml" title="RSS" href="../../rss.xml">
<link rel="canonical" href="https://wisonwang.github.io/posts/python-grpc-shi-yong/">
<!--[if lt IE 9]><script src="/assets/js/html5.js"></script><![endif]--><meta name="author" content="vincent wang">
<meta property="og:site_name" content="vincent blog">
<meta property="og:title" content="python grpc 使用">
<meta property="og:url" content="https://wisonwang.github.io/posts/python-grpc-shi-yong/">
<meta property="og:description" content="grpc 是google开发的远程通信协议,和它最相近的产品的产品是apache基金会下的thrift协议。
两者都是很优秀的通信中间件产品，拥有很好的性能，支持大多数主要语言。
相对于thrift协议，更年轻，更轻量，grpc基于http2传输协议和protocol buffer(也可以使用json)序列化协议。



这也带来相对于thrfit的优点：



http2相对于thrfit的tc">
<meta property="og:type" content="article">
<meta property="article:published_time" content="2019-10-11T09:48:21+08:00">
</head>
<body>
    <section class="social"><ul>
<li><a href="../../index.html" title="Home"><i class="icon-home"></i></a></li>
            <li><a href="../../archive.html" title="文章存档"><i class="icon-archive"></i></a></li>
            <li><a href="../../categories/" title="标签"><i class="icon-tags"></i></a></li>
            <li><a href="../../pages/about" title="About"><i class="icon-about"></i></a></li>
            <li><a href="../../rss.xml" title="RSS 源"><i class="icon-rss"></i></a></li>
            <li><a href="https://twitter.com/wisonwang" title="My Twitter"><i class="icon-twitter"></i></a></li>
            <li><a href="https://github.com/wisonwang" title="My Github"><i class="icon-github"></i></a></li>

        </ul></section><section class="page-content"><div class="content" rel="main">
    <div class="post">
        <h1 class="p-name entry-title" itemprop="headline name">python grpc 使用</h1>

        <div class="meta">
            <div class="authordate">
                <time class="timeago" datetime="2019-10-11T09:48:21+08:00">2019-10-11 09:48</time>
            
                      |  
        <a href="index.org" id="sourcelink">源代码</a>

            </div>
            
        </div>
        <div class="body">
            <p>
grpc 是google开发的远程通信协议,和它最相近的产品的产品是apache基金会下的thrift协议。
两者都是很优秀的通信中间件产品，拥有很好的性能，支持大多数主要语言。
相对于thrift协议，更年轻，更轻量，grpc基于http2传输协议和protocol buffer(也可以使用json)序列化协议。
</p>

<p>
这也带来相对于thrfit的优点：
</p>

<ol class="org-ol">
<li>http2相对于thrfit的tcp协议更容易扩展，参见<sup><a id="fnr.1" class="footref" href="#fn.1">1</a></sup>:

<ul class="org-ul">
<li>相对于http1.x,http2采用二进制传输，同时多次请求时会对http协议的header信息进行压缩，从而大幅提高http2的性能</li>

<li>多路复用/请求流控制，相对于http1是同步请求，一个链接同一时间只能处理一个请求。http2是完全异步请求，
在同一个tcp链接上客户端和服务端可以同时进行多次请求响应。</li>

<li>基于多路复用和请求流控制，通过新增了一个带stream参数的流化或者类似于管道通信功能，这一点和通常的rpc协议差别很大，
不管在服务端实现上还是客户端调用上都和常规的rpc请求不同，后面的例子中可以具体看到这种差异.</li>

<li>易于扩展，例如：在异构系统（例如微服务系统）中，一次真是的客户端请求发生了，实际在发生很多次的服务间调用，
使用http协议可以方便的扩展，增加调用堆栈/流信息，方便日志记录。</li>
</ul>
</li>

<li>protocol buffer 本身是一个独立的高性能序列化协议，在程序内部能够有很好的通用性，可以直接作为内部数据的表示方式，也可以直接
用于缓存数据。</li>
</ol>
<!-- TEASER_END --><p>
如下简单看下，如何使用python创建grpc服务。
</p>

<p>
参考官方的地图导航例子：
[[<a href="https://github.com/grpc/grpc/blob/v1.24.0/examples/protos/route_guide.proto">https://github.com/grpc/grpc/blob/v1.24.0/examples/protos/route_guide.proto</a>]\
iigrpc router guide]]
</p>

<div id="outline-container-org526ddf6" class="outline-2">
<h2 id="org526ddf6">创建.proto</h2>
<div class="outline-text-2" id="text-org526ddf6">
<p>
创建.proto文件：
</p>

<div class="highlight"><pre><span></span>vi router_guide.proto
</pre></div>

<p>
编辑以下内容：
</p>

<div class="highlight"><pre><span></span><span class="n">syntax</span> <span class="o">=</span> <span class="s">"proto3"</span><span class="p">;</span>

<span class="c1">// 下面是生成java代码需要的声明</span>
<span class="n">option</span> <span class="n">java_multiple_files</span> <span class="o">=</span> <span class="nb">true</span><span class="p">;</span>
<span class="n">option</span> <span class="n">java_package</span> <span class="o">=</span> <span class="s">"io.grpc.examples.routeguide"</span><span class="p">;</span>
<span class="n">option</span> <span class="n">java_outer_classname</span> <span class="o">=</span> <span class="s">"RouteGuideProto"</span><span class="p">;</span>

<span class="c1">// objectc 选项</span>
<span class="n">option</span> <span class="n">objc_class_prefix</span> <span class="o">=</span> <span class="s">"RTG"</span><span class="p">;</span>

<span class="c1">// 很多语言都需要的生成代码的目标包(python,go,java 等)或者命名空间（c++）</span>
<span class="n">package</span> <span class="n">routeguide</span><span class="p">;</span>

<span class="c1">// 定义接口.</span>
<span class="n">service</span> <span class="n">RouteGuide</span> <span class="p">{</span>
  <span class="c1">// 第一个简单非流化rpc接口 单向通信，客户端传入一个位置，服务端返回这个位置的兴趣点</span>
  <span class="n">rpc</span> <span class="n">GetFeature</span><span class="p">(</span><span class="n">Point</span><span class="p">)</span> <span class="n">returns</span> <span class="p">(</span><span class="n">Feature</span><span class="p">)</span> <span class="p">{}</span>

  <span class="c1">// 单向流化接口</span>
  <span class="c1">// 服务端返回结果流化接口 </span>
  <span class="c1">// 获取置顶矩形区域内的所有兴趣</span>
  <span class="c1">// 因为返回的结果可能会很多 所以结果不是一次返回，而是流化的，类似于服务端通过管道将返回的</span>
  <span class="n">rpc</span> <span class="n">ListFeatures</span><span class="p">(</span><span class="n">Rectangle</span><span class="p">)</span> <span class="n">returns</span> <span class="p">(</span><span class="n">stream</span> <span class="n">Feature</span><span class="p">)</span> <span class="p">{}</span>

  <span class="c1">// 单向流化接口 </span>
  <span class="c1">// 客户端输入参数流化接口</span>
  <span class="c1">// 传入一个流化的位置集合，等所有流化参数都传输玩了，服务端一次性 返回路由汇总信息</span>
  <span class="n">rpc</span> <span class="n">RecordRoute</span><span class="p">(</span><span class="n">stream</span> <span class="n">Point</span><span class="p">)</span> <span class="n">returns</span> <span class="p">(</span><span class="n">RouteSummary</span><span class="p">)</span> <span class="p">{}</span>

  <span class="c1">// 双向流化接口</span>
  <span class="c1">// 在双向流化接口中 客户端的输入流化参数和server端的返回流化结果，客户端和同时完全异步的相互“推送信息”</span>
  <span class="n">rpc</span> <span class="n">RouteChat</span><span class="p">(</span><span class="n">stream</span> <span class="n">RouteNote</span><span class="p">)</span> <span class="n">returns</span> <span class="p">(</span><span class="n">stream</span> <span class="n">RouteNote</span><span class="p">)</span> <span class="p">{}</span>
<span class="p">}</span>

<span class="c1">// 位置点</span>
<span class="n">message</span> <span class="n">Point</span> <span class="p">{</span>
  <span class="c1">// 纬度*10的7次方 </span>
  <span class="n">int32</span> <span class="n">latitude</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
  <span class="c1">// 精度*10的7次方 </span>
  <span class="n">int32</span> <span class="n">longitude</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
<span class="p">}</span>

<span class="c1">// 矩形区域 两个位置点为 对角线，生成一个矩形区域</span>
<span class="n">message</span> <span class="n">Rectangle</span> <span class="p">{</span>
  <span class="n">Point</span> <span class="n">lo</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>

  <span class="n">Point</span> <span class="n">hi</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
<span class="p">}</span>

<span class="c1">// 兴趣点</span>
<span class="n">message</span> <span class="n">Feature</span> <span class="p">{</span>
  <span class="n">string</span> <span class="n">name</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
  <span class="n">Point</span> <span class="n">location</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
<span class="p">}</span>

<span class="c1">// A RouteNote is a message sent while at a given point.</span>
<span class="n">message</span> <span class="n">RouteNote</span> <span class="p">{</span>
  <span class="c1">// The location from which the message is sent.</span>
  <span class="n">Point</span> <span class="n">location</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>

  <span class="c1">// The message to be sent.</span>
  <span class="n">string</span> <span class="n">message</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
<span class="p">}</span>

<span class="c1">// A RouteSummary is received in response to a RecordRoute rpc.</span>
<span class="c1">//</span>
<span class="c1">// It contains the number of individual points received, the number of</span>
<span class="c1">// detected features, and the total distance covered as the cumulative sum of</span>
<span class="c1">// the distance between each point.</span>
<span class="n">message</span> <span class="n">RouteSummary</span> <span class="p">{</span>
  <span class="c1">// The number of points received.</span>
  <span class="n">int32</span> <span class="n">point_count</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>

  <span class="c1">// The number of known features passed while traversing the route.</span>
  <span class="n">int32</span> <span class="n">feature_count</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>

  <span class="c1">// The distance covered in metres.</span>
  <span class="n">int32</span> <span class="n">distance</span> <span class="o">=</span> <span class="mi">3</span><span class="p">;</span>

  <span class="c1">// The duration of the traversal in seconds.</span>
  <span class="n">int32</span> <span class="n">elapsed_time</span> <span class="o">=</span> <span class="mi">4</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
</div>

<div id="outline-container-org4717047" class="outline-2">
<h2 id="org4717047">编译</h2>
<div class="outline-text-2" id="text-org4717047">
<p>
安装grpcio-tools
</p>

<div class="highlight"><pre><span></span>pip install grpcio-tools
</pre></div>

<p>
编译:
</p>

<div class="highlight"><pre><span></span>python -m grpc_tools.protoc -I./ --python_out=. --grpc_python_out=. route_guide.proto
</pre></div>

<p>
编译会生成两个文件，$package<sub>name</sub>+"<sub>pb2.py</sub>" 和 $package<sub>name</sub> + "<sub>pb2</sub><sub>grpc.py</sub>", 前者实现了结构体的序列化协议，后者实现了grpc的通信接口。
</p>

<p>
(需要注意的是生成的<sub>pb2这个后缀表示的pb对于的python</sub> pb api的实现版本，不是pb IDL语言协议的"proto3")
</p>
</div>
</div>

<div id="outline-container-orga635cbf" class="outline-2">
<h2 id="orga635cbf">编写server-client代码</h2>
<div class="outline-text-2" id="text-orga635cbf">
<p>
client 样例：
</p>

<div class="highlight"><pre><span></span><span class="c1"># -*- coding: utf-8 -*-</span>

<span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">print_function</span>

<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">random</span>
<span class="kn">import</span> <span class="nn">time</span>

<span class="kn">import</span> <span class="nn">grpc</span>

<span class="kn">import</span> <span class="nn">route_guide_pb2</span>
<span class="kn">import</span> <span class="nn">route_guide_pb2_grpc</span>
<span class="kn">import</span> <span class="nn">route_guide_resources</span>


<span class="k">def</span> <span class="nf">make_route_note</span><span class="p">(</span><span class="n">message</span><span class="p">,</span> <span class="n">latitude</span><span class="p">,</span> <span class="n">longitude</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">route_guide_pb2</span><span class="o">.</span><span class="n">RouteNote</span><span class="p">(</span><span class="n">message</span><span class="o">=</span><span class="n">message</span><span class="p">,</span>
				     <span class="n">location</span><span class="o">=</span><span class="n">route_guide_pb2</span><span class="o">.</span><span class="n">Point</span><span class="p">(</span>
					 <span class="n">latitude</span><span class="o">=</span><span class="n">latitude</span><span class="p">,</span>
					 <span class="n">longitude</span><span class="o">=</span><span class="n">longitude</span><span class="p">))</span>


<span class="k">def</span> <span class="nf">guide_get_one_feature</span><span class="p">(</span><span class="n">stub</span><span class="p">,</span> <span class="n">point</span><span class="p">):</span>
    <span class="n">feature</span> <span class="o">=</span> <span class="n">stub</span><span class="o">.</span><span class="n">GetFeature</span><span class="p">(</span><span class="n">point</span><span class="p">)</span>
    <span class="k">if</span> <span class="ow">not</span> <span class="n">feature</span><span class="o">.</span><span class="n">location</span><span class="p">:</span>
	<span class="nb">print</span><span class="p">(</span><span class="s2">"Server returned incomplete feature"</span><span class="p">)</span>
	<span class="k">return</span>

    <span class="k">if</span> <span class="n">feature</span><span class="o">.</span><span class="n">name</span><span class="p">:</span>
	<span class="nb">print</span><span class="p">(</span><span class="s2">"Feature called </span><span class="si">%s</span><span class="s2"> at </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">feature</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">feature</span><span class="o">.</span><span class="n">location</span><span class="p">))</span>
    <span class="k">else</span><span class="p">:</span>
	<span class="nb">print</span><span class="p">(</span><span class="s2">"Found no feature at </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">feature</span><span class="o">.</span><span class="n">location</span><span class="p">)</span>


<span class="k">def</span> <span class="nf">guide_get_feature</span><span class="p">(</span><span class="n">stub</span><span class="p">):</span>
    <span class="n">guide_get_one_feature</span><span class="p">(</span>
	<span class="n">stub</span><span class="p">,</span> <span class="n">route_guide_pb2</span><span class="o">.</span><span class="n">Point</span><span class="p">(</span><span class="n">latitude</span><span class="o">=</span><span class="mi">409146138</span><span class="p">,</span> <span class="n">longitude</span><span class="o">=-</span><span class="mi">746188906</span><span class="p">))</span>
    <span class="n">guide_get_one_feature</span><span class="p">(</span><span class="n">stub</span><span class="p">,</span> <span class="n">route_guide_pb2</span><span class="o">.</span><span class="n">Point</span><span class="p">(</span><span class="n">latitude</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">longitude</span><span class="o">=</span><span class="mi">0</span><span class="p">))</span>


<span class="k">def</span> <span class="nf">guide_list_features</span><span class="p">(</span><span class="n">stub</span><span class="p">):</span>
    <span class="n">rectangle</span> <span class="o">=</span> <span class="n">route_guide_pb2</span><span class="o">.</span><span class="n">Rectangle</span><span class="p">(</span>
	<span class="n">lo</span><span class="o">=</span><span class="n">route_guide_pb2</span><span class="o">.</span><span class="n">Point</span><span class="p">(</span><span class="n">latitude</span><span class="o">=</span><span class="mi">400000000</span><span class="p">,</span> <span class="n">longitude</span><span class="o">=-</span><span class="mi">750000000</span><span class="p">),</span>
	<span class="n">hi</span><span class="o">=</span><span class="n">route_guide_pb2</span><span class="o">.</span><span class="n">Point</span><span class="p">(</span><span class="n">latitude</span><span class="o">=</span><span class="mi">420000000</span><span class="p">,</span> <span class="n">longitude</span><span class="o">=-</span><span class="mi">730000000</span><span class="p">))</span>
    <span class="nb">print</span><span class="p">(</span><span class="s2">"Looking for features between 40, -75 and 42, -73"</span><span class="p">)</span>

    <span class="n">features</span> <span class="o">=</span> <span class="n">stub</span><span class="o">.</span><span class="n">ListFeatures</span><span class="p">(</span><span class="n">rectangle</span><span class="p">)</span>

    <span class="k">for</span> <span class="n">feature</span> <span class="ow">in</span> <span class="n">features</span><span class="p">:</span>
	<span class="nb">print</span><span class="p">(</span><span class="s2">"Feature called </span><span class="si">%s</span><span class="s2"> at </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">feature</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">feature</span><span class="o">.</span><span class="n">location</span><span class="p">))</span>


<span class="k">def</span> <span class="nf">generate_route</span><span class="p">(</span><span class="n">feature_list</span><span class="p">):</span>
    <span class="k">for</span> <span class="n">_</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">10</span><span class="p">):</span>
	<span class="n">random_feature</span> <span class="o">=</span> <span class="n">feature_list</span><span class="p">[</span><span class="n">random</span><span class="o">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">feature_list</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)]</span>
	<span class="c1"># 延迟以下 因为返回路径是一个兴趣点列表的迭代器 所以服务端接受时 也是拿到一个迭代器，相当于一个管道，客户端生成一个兴趣点，服务端就接受一个，而不是一次性接受所有生成的兴趣点</span>
	<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mf">0.001</span><span class="p">)</span>
	<span class="nb">print</span><span class="p">(</span><span class="s2">"Visiting point </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">random_feature</span><span class="o">.</span><span class="n">location</span><span class="p">)</span>
	<span class="k">yield</span> <span class="n">random_feature</span><span class="o">.</span><span class="n">location</span>


<span class="k">def</span> <span class="nf">guide_record_route</span><span class="p">(</span><span class="n">stub</span><span class="p">):</span>
    <span class="n">feature_list</span> <span class="o">=</span> <span class="n">route_guide_resources</span><span class="o">.</span><span class="n">read_route_guide_database</span><span class="p">()</span>

    <span class="n">route_iterator</span> <span class="o">=</span> <span class="n">generate_route</span><span class="p">(</span><span class="n">feature_list</span><span class="p">)</span>
    <span class="n">route_summary</span> <span class="o">=</span> <span class="n">stub</span><span class="o">.</span><span class="n">RecordRoute</span><span class="p">(</span><span class="n">route_iterator</span><span class="p">)</span>
    <span class="nb">print</span><span class="p">(</span><span class="s2">"Finished trip with </span><span class="si">%s</span><span class="s2"> points "</span> <span class="o">%</span> <span class="n">route_summary</span><span class="o">.</span><span class="n">point_count</span><span class="p">)</span>
    <span class="nb">print</span><span class="p">(</span><span class="s2">"Passed </span><span class="si">%s</span><span class="s2"> features "</span> <span class="o">%</span> <span class="n">route_summary</span><span class="o">.</span><span class="n">feature_count</span><span class="p">)</span>
    <span class="nb">print</span><span class="p">(</span><span class="s2">"Travelled </span><span class="si">%s</span><span class="s2"> meters "</span> <span class="o">%</span> <span class="n">route_summary</span><span class="o">.</span><span class="n">distance</span><span class="p">)</span>
    <span class="nb">print</span><span class="p">(</span><span class="s2">"It took </span><span class="si">%s</span><span class="s2"> seconds "</span> <span class="o">%</span> <span class="n">route_summary</span><span class="o">.</span><span class="n">elapsed_time</span><span class="p">)</span>


<span class="k">def</span> <span class="nf">generate_messages</span><span class="p">():</span>
    <span class="n">messages</span> <span class="o">=</span> <span class="p">[</span>
	<span class="n">make_route_note</span><span class="p">(</span><span class="s2">"First message"</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
	<span class="n">make_route_note</span><span class="p">(</span><span class="s2">"Second message"</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
	<span class="n">make_route_note</span><span class="p">(</span><span class="s2">"Third message"</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
	<span class="n">make_route_note</span><span class="p">(</span><span class="s2">"Fourth message"</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
	<span class="n">make_route_note</span><span class="p">(</span><span class="s2">"Fifth message"</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
    <span class="p">]</span>
    <span class="k">for</span> <span class="n">msg</span> <span class="ow">in</span> <span class="n">messages</span><span class="p">:</span>
	<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mf">0.1</span><span class="p">)</span>
	<span class="nb">print</span><span class="p">(</span><span class="s2">"Sending </span><span class="si">%s</span><span class="s2"> at </span><span class="si">%s</span><span class="s2"> time: </span><span class="si">%d</span><span class="s2">"</span> <span class="o">%</span>
	      <span class="p">(</span><span class="n">msg</span><span class="o">.</span><span class="n">message</span><span class="p">,</span> <span class="n">msg</span><span class="o">.</span><span class="n">location</span><span class="p">,</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">*</span> <span class="mi">1000</span><span class="p">))</span>
	<span class="k">yield</span> <span class="n">msg</span>


<span class="k">def</span> <span class="nf">guide_route_chat</span><span class="p">(</span><span class="n">stub</span><span class="p">):</span>
    <span class="n">responses</span> <span class="o">=</span> <span class="n">stub</span><span class="o">.</span><span class="n">RouteChat</span><span class="p">(</span><span class="n">generate_messages</span><span class="p">())</span>
    <span class="k">for</span> <span class="n">response</span> <span class="ow">in</span> <span class="n">responses</span><span class="p">:</span>
	<span class="nb">print</span><span class="p">(</span><span class="s2">"Received message </span><span class="si">%s</span><span class="s2"> at </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span>
	      <span class="p">(</span><span class="n">response</span><span class="o">.</span><span class="n">message</span><span class="p">,</span> <span class="n">response</span><span class="o">.</span><span class="n">location</span><span class="p">))</span>


<span class="k">def</span> <span class="nf">run</span><span class="p">():</span>
    <span class="c1"># NOTE(gRPC Python Team): .close() is possible on a channel and should be</span>
    <span class="c1"># used in circumstances in which the with statement does not fit the needs</span>
    <span class="c1"># of the code.</span>
    <span class="k">with</span> <span class="n">grpc</span><span class="o">.</span><span class="n">insecure_channel</span><span class="p">(</span><span class="s1">'localhost:50051'</span><span class="p">)</span> <span class="k">as</span> <span class="n">channel</span><span class="p">:</span>
	<span class="n">stub</span> <span class="o">=</span> <span class="n">route_guide_pb2_grpc</span><span class="o">.</span><span class="n">RouteGuideStub</span><span class="p">(</span><span class="n">channel</span><span class="p">)</span>
	<span class="nb">print</span><span class="p">(</span><span class="s2">"-------------- GetFeature --------------"</span><span class="p">)</span>
	<span class="n">guide_get_feature</span><span class="p">(</span><span class="n">stub</span><span class="p">)</span>
	<span class="nb">print</span><span class="p">(</span><span class="s2">"-------------- ListFeatures --------------"</span><span class="p">)</span>
	<span class="n">guide_list_features</span><span class="p">(</span><span class="n">stub</span><span class="p">)</span>
	<span class="nb">print</span><span class="p">(</span><span class="s2">"-------------- RecordRoute --------------"</span><span class="p">)</span>
	<span class="n">guide_record_route</span><span class="p">(</span><span class="n">stub</span><span class="p">)</span>
	<span class="nb">print</span><span class="p">(</span><span class="s2">"-------------- RouteChat --------------"</span><span class="p">)</span>
	<span class="n">guide_route_chat</span><span class="p">(</span><span class="n">stub</span><span class="p">)</span>


<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">'__main__'</span><span class="p">:</span>
    <span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">()</span>
    <span class="n">run</span><span class="p">()</span>
</pre></div>

<p>
server 样例:
</p>

<div class="highlight"><pre><span></span><span class="c1"># -*- coding: utf-8 -*-</span>

<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">math</span>
<span class="kn">import</span> <span class="nn">time</span>
<span class="kn">from</span> <span class="nn">concurrent</span> <span class="kn">import</span> <span class="n">futures</span>

<span class="kn">import</span> <span class="nn">grpc</span>

<span class="kn">import</span> <span class="nn">route_guide_pb2</span>
<span class="kn">import</span> <span class="nn">route_guide_pb2_grpc</span>
<span class="kn">import</span> <span class="nn">route_guide_resources</span>


<span class="k">def</span> <span class="nf">get_feature</span><span class="p">(</span><span class="n">feature_db</span><span class="p">,</span> <span class="n">point</span><span class="p">):</span>
    <span class="sd">"""Returns Feature at given location or None."""</span>
    <span class="k">for</span> <span class="n">feature</span> <span class="ow">in</span> <span class="n">feature_db</span><span class="p">:</span>
	<span class="k">if</span> <span class="n">feature</span><span class="o">.</span><span class="n">location</span> <span class="o">==</span> <span class="n">point</span><span class="p">:</span>
	    <span class="k">return</span> <span class="n">feature</span>
    <span class="k">return</span> <span class="kc">None</span>


<span class="k">def</span> <span class="nf">get_distance</span><span class="p">(</span><span class="n">start</span><span class="p">,</span> <span class="n">end</span><span class="p">):</span>
    <span class="sd">"""Distance between two points."""</span>
    <span class="n">coord_factor</span> <span class="o">=</span> <span class="mf">10000000.0</span>
    <span class="n">lat_1</span> <span class="o">=</span> <span class="n">start</span><span class="o">.</span><span class="n">latitude</span> <span class="o">/</span> <span class="n">coord_factor</span>
    <span class="n">lat_2</span> <span class="o">=</span> <span class="n">end</span><span class="o">.</span><span class="n">latitude</span> <span class="o">/</span> <span class="n">coord_factor</span>
    <span class="n">lon_1</span> <span class="o">=</span> <span class="n">start</span><span class="o">.</span><span class="n">longitude</span> <span class="o">/</span> <span class="n">coord_factor</span>
    <span class="n">lon_2</span> <span class="o">=</span> <span class="n">end</span><span class="o">.</span><span class="n">longitude</span> <span class="o">/</span> <span class="n">coord_factor</span>
    <span class="n">lat_rad_1</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">radians</span><span class="p">(</span><span class="n">lat_1</span><span class="p">)</span>
    <span class="n">lat_rad_2</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">radians</span><span class="p">(</span><span class="n">lat_2</span><span class="p">)</span>
    <span class="n">delta_lat_rad</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">radians</span><span class="p">(</span><span class="n">lat_2</span> <span class="o">-</span> <span class="n">lat_1</span><span class="p">)</span>
    <span class="n">delta_lon_rad</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">radians</span><span class="p">(</span><span class="n">lon_2</span> <span class="o">-</span> <span class="n">lon_1</span><span class="p">)</span>

    <span class="c1"># Formula is based on http://mathforum.org/library/drmath/view/51879.html</span>
    <span class="n">a</span> <span class="o">=</span> <span class="p">(</span><span class="nb">pow</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="n">delta_lat_rad</span> <span class="o">/</span> <span class="mi">2</span><span class="p">),</span> <span class="mi">2</span><span class="p">)</span> <span class="o">+</span>
	 <span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="n">lat_rad_1</span><span class="p">)</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="n">lat_rad_2</span><span class="p">)</span> <span class="o">*</span>
	  <span class="nb">pow</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="n">delta_lon_rad</span> <span class="o">/</span> <span class="mi">2</span><span class="p">),</span> <span class="mi">2</span><span class="p">)))</span>
    <span class="n">c</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">atan2</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">a</span><span class="p">),</span> <span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="n">a</span><span class="p">))</span>
    <span class="n">R</span> <span class="o">=</span> <span class="mi">6371000</span>
    <span class="c1"># metres</span>
    <span class="k">return</span> <span class="n">R</span> <span class="o">*</span> <span class="n">c</span>


<span class="k">class</span> <span class="nc">RouteGuideServicer</span><span class="p">(</span><span class="n">route_guide_pb2_grpc</span><span class="o">.</span><span class="n">RouteGuideServicer</span><span class="p">):</span>
    <span class="sd">"""Provides methods that implement functionality of route guide server."""</span>
    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
	<span class="bp">self</span><span class="o">.</span><span class="n">db</span> <span class="o">=</span> <span class="n">route_guide_resources</span><span class="o">.</span><span class="n">read_route_guide_database</span><span class="p">()</span>

    <span class="k">def</span> <span class="nf">GetFeature</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">request</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
	<span class="n">feature</span> <span class="o">=</span> <span class="n">get_feature</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
	<span class="k">if</span> <span class="n">feature</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
	    <span class="k">return</span> <span class="n">route_guide_pb2</span><span class="o">.</span><span class="n">Feature</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s2">""</span><span class="p">,</span> <span class="n">location</span><span class="o">=</span><span class="n">request</span><span class="p">)</span>
	<span class="k">else</span><span class="p">:</span>
	    <span class="k">return</span> <span class="n">feature</span>

    <span class="k">def</span> <span class="nf">ListFeatures</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">request</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
	<span class="n">left</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">lo</span><span class="o">.</span><span class="n">longitude</span><span class="p">,</span> <span class="n">request</span><span class="o">.</span><span class="n">hi</span><span class="o">.</span><span class="n">longitude</span><span class="p">)</span>
	<span class="n">right</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">lo</span><span class="o">.</span><span class="n">longitude</span><span class="p">,</span> <span class="n">request</span><span class="o">.</span><span class="n">hi</span><span class="o">.</span><span class="n">longitude</span><span class="p">)</span>
	<span class="n">top</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">lo</span><span class="o">.</span><span class="n">latitude</span><span class="p">,</span> <span class="n">request</span><span class="o">.</span><span class="n">hi</span><span class="o">.</span><span class="n">latitude</span><span class="p">)</span>
	<span class="n">bottom</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">lo</span><span class="o">.</span><span class="n">latitude</span><span class="p">,</span> <span class="n">request</span><span class="o">.</span><span class="n">hi</span><span class="o">.</span><span class="n">latitude</span><span class="p">)</span>
	<span class="k">for</span> <span class="n">feature</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="p">:</span>
	    <span class="k">if</span> <span class="p">(</span><span class="n">feature</span><span class="o">.</span><span class="n">location</span><span class="o">.</span><span class="n">longitude</span> <span class="o">&gt;=</span> <span class="n">left</span>
		    <span class="ow">and</span> <span class="n">feature</span><span class="o">.</span><span class="n">location</span><span class="o">.</span><span class="n">longitude</span> <span class="o">&lt;=</span> <span class="n">right</span>
		    <span class="ow">and</span> <span class="n">feature</span><span class="o">.</span><span class="n">location</span><span class="o">.</span><span class="n">latitude</span> <span class="o">&gt;=</span> <span class="n">bottom</span>
		    <span class="ow">and</span> <span class="n">feature</span><span class="o">.</span><span class="n">location</span><span class="o">.</span><span class="n">latitude</span> <span class="o">&lt;=</span> <span class="n">top</span><span class="p">):</span>
		<span class="k">yield</span> <span class="n">feature</span>

    <span class="k">def</span> <span class="nf">RecordRoute</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">request_iterator</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
	<span class="n">point_count</span> <span class="o">=</span> <span class="mi">0</span>
	<span class="n">feature_count</span> <span class="o">=</span> <span class="mi">0</span>
	<span class="n">distance</span> <span class="o">=</span> <span class="mf">0.0</span>
	<span class="n">prev_point</span> <span class="o">=</span> <span class="kc">None</span>

	<span class="n">start_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
	<span class="k">for</span> <span class="n">point</span> <span class="ow">in</span> <span class="n">request_iterator</span><span class="p">:</span>
	    <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mf">0.001</span><span class="p">)</span>
	    <span class="nb">print</span><span class="p">(</span><span class="s2">"record one route point:"</span><span class="p">,</span> <span class="n">point</span><span class="p">)</span>
	    <span class="n">point_count</span> <span class="o">+=</span> <span class="mi">1</span>
	    <span class="k">if</span> <span class="n">get_feature</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="p">,</span> <span class="n">point</span><span class="p">):</span>
		<span class="n">feature_count</span> <span class="o">+=</span> <span class="mi">1</span>
	    <span class="k">if</span> <span class="n">prev_point</span><span class="p">:</span>
		<span class="n">distance</span> <span class="o">+=</span> <span class="n">get_distance</span><span class="p">(</span><span class="n">prev_point</span><span class="p">,</span> <span class="n">point</span><span class="p">)</span>
	    <span class="n">prev_point</span> <span class="o">=</span> <span class="n">point</span>

	<span class="n">elapsed_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">-</span> <span class="n">start_time</span>
	<span class="k">return</span> <span class="n">route_guide_pb2</span><span class="o">.</span><span class="n">RouteSummary</span><span class="p">(</span><span class="n">point_count</span><span class="o">=</span><span class="n">point_count</span><span class="p">,</span>
					    <span class="n">feature_count</span><span class="o">=</span><span class="n">feature_count</span><span class="p">,</span>
					    <span class="n">distance</span><span class="o">=</span><span class="nb">int</span><span class="p">(</span><span class="n">distance</span><span class="p">),</span>
					    <span class="n">elapsed_time</span><span class="o">=</span><span class="nb">int</span><span class="p">(</span><span class="n">elapsed_time</span><span class="p">))</span>

    <span class="k">def</span> <span class="nf">RouteChat</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">request_iterator</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
	<span class="n">prev_notes</span> <span class="o">=</span> <span class="p">[]</span>
	<span class="c1"># time.sleep(1)</span>
	<span class="k">for</span> <span class="n">new_note</span> <span class="ow">in</span> <span class="n">request_iterator</span><span class="p">:</span>
	    <span class="k">for</span> <span class="n">prev_note</span> <span class="ow">in</span> <span class="n">prev_notes</span><span class="p">:</span>
		<span class="k">if</span> <span class="n">prev_note</span><span class="o">.</span><span class="n">location</span> <span class="o">==</span> <span class="n">new_note</span><span class="o">.</span><span class="n">location</span><span class="p">:</span>
		    <span class="k">yield</span> <span class="n">prev_note</span>
	    <span class="n">prev_notes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">new_note</span><span class="p">)</span>


<span class="k">def</span> <span class="nf">serve</span><span class="p">():</span>
    <span class="n">server</span> <span class="o">=</span> <span class="n">grpc</span><span class="o">.</span><span class="n">server</span><span class="p">(</span><span class="n">futures</span><span class="o">.</span><span class="n">ThreadPoolExecutor</span><span class="p">(</span><span class="n">max_workers</span><span class="o">=</span><span class="mi">10</span><span class="p">))</span>
    <span class="n">route_guide_pb2_grpc</span><span class="o">.</span><span class="n">add_RouteGuideServicer_to_server</span><span class="p">(</span>
	<span class="n">RouteGuideServicer</span><span class="p">(),</span> <span class="n">server</span><span class="p">)</span>
    <span class="n">server</span><span class="o">.</span><span class="n">add_insecure_port</span><span class="p">(</span><span class="s1">'[::]:50051'</span><span class="p">)</span>
    <span class="n">server</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
    <span class="n">server</span><span class="o">.</span><span class="n">wait_for_termination</span><span class="p">()</span>


<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">'__main__'</span><span class="p">:</span>
    <span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">()</span>
    <span class="n">serve</span><span class="p">()</span>
</pre></div>

<div class="highlight"><pre><span></span><span class="c1"># -*- coding: utf-8 -*-</span>
<span class="sd">"""</span>
<span class="sd">演示多客户端请求grpc server</span>

<span class="sd">"""</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">signal</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">threading</span>
<span class="kn">import</span> <span class="nn">time</span>
<span class="kn">from</span> <span class="nn">concurrent</span> <span class="kn">import</span> <span class="n">futures</span>

<span class="kn">from</span> <span class="nn">route_guide_client</span> <span class="kn">import</span> <span class="n">run</span> <span class="k">as</span> <span class="n">runclient</span>
<span class="kn">from</span> <span class="nn">route_guide_server</span> <span class="kn">import</span> <span class="n">serve</span>


<span class="k">def</span> <span class="nf">main</span><span class="p">():</span>
    <span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">()</span>
    <span class="nb">print</span><span class="p">(</span><span class="s2">"start grpc server:"</span><span class="p">)</span>
    <span class="n">server_thread</span> <span class="o">=</span> <span class="n">threading</span><span class="o">.</span><span class="n">Thread</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="n">serve</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">())</span>

    <span class="n">server_thread</span><span class="o">.</span><span class="n">setDaemon</span><span class="p">(</span><span class="kc">True</span><span class="p">)</span>
    <span class="n">server_thread</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
    <span class="c1"># wait server start</span>
    <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>

    <span class="c1"># start n clients</span>

    <span class="n">n</span> <span class="o">=</span> <span class="mi">1</span>
    <span class="n">client_executor</span> <span class="o">=</span> <span class="n">futures</span><span class="o">.</span><span class="n">ThreadPoolExecutor</span><span class="p">(</span><span class="n">n</span><span class="p">)</span>

    <span class="n">client_executor</span><span class="o">.</span><span class="n">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">runclient</span><span class="p">(),</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">))</span>

    <span class="n">server_thread</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
    <span class="nb">print</span><span class="p">(</span><span class="s2">"exit"</span><span class="p">)</span>
    <span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>


<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">'__main__'</span><span class="p">:</span>
    <span class="n">main</span><span class="p">()</span>
</pre></div>
</div>
</div>


<div id="outline-container-orgf419ee7" class="outline-2">
<h2 id="orgf419ee7">运行演示</h2>
<div class="outline-text-2" id="text-orgf419ee7">
<div class="highlight"><pre><span></span>cd ../files/python-grpc/

python demo.py &gt; output.log
</pre></div>

<p>
输出:
</p>

<div class="highlight"><pre><span></span><span class="n">start</span> <span class="n">grpc</span> <span class="n">server</span><span class="p">:</span>
<span class="o">--------------</span> <span class="n">GetFeature</span> <span class="o">--------------</span>
<span class="n">Feature</span> <span class="n">called</span> <span class="n">Berkshire</span> <span class="n">Valley</span> <span class="n">Management</span> <span class="n">Area</span> <span class="n">Trail</span><span class="p">,</span> <span class="n">Jefferson</span><span class="p">,</span> <span class="n">NJ</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">409146138</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746188906</span>

<span class="n">Found</span> <span class="n">no</span> <span class="n">feature</span> <span class="n">at</span> 
<span class="o">--------------</span> <span class="n">ListFeatures</span> <span class="o">--------------</span>
<span class="n">Looking</span> <span class="k">for</span> <span class="n">features</span> <span class="n">between</span> <span class="mi">40</span><span class="p">,</span> <span class="o">-</span><span class="mi">75</span> <span class="ow">and</span> <span class="mi">42</span><span class="p">,</span> <span class="o">-</span><span class="mi">73</span>
<span class="n">Feature</span> <span class="n">called</span> <span class="n">Patriots</span> <span class="n">Path</span><span class="p">,</span> <span class="n">Mendham</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07945</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">407838351</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746143763</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">101</span> <span class="n">New</span> <span class="n">Jersey</span> <span class="mi">10</span><span class="p">,</span> <span class="n">Whippany</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07981</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">408122808</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743999179</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="n">U</span><span class="o">.</span><span class="n">S</span><span class="o">.</span> <span class="mi">6</span><span class="p">,</span> <span class="n">Shohola</span><span class="p">,</span> <span class="n">PA</span> <span class="mi">18458</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">413628156</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">749015468</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">5</span> <span class="n">Conners</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Kingston</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12401</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">419999544</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740371136</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="n">Mid</span> <span class="n">Hudson</span> <span class="n">Psychiatric</span> <span class="n">Center</span><span class="p">,</span> <span class="n">New</span> <span class="n">Hampton</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">10958</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">414008389</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743951297</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">287</span> <span class="n">Flugertown</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Livingston</span> <span class="n">Manor</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12758</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">419611318</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746524769</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">4001</span> <span class="n">Tremley</span> <span class="n">Point</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Linden</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07036</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406109563</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742186778</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">352</span> <span class="n">South</span> <span class="n">Mountain</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Wallkill</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12589</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">416802456</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742370183</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="n">Bailey</span> <span class="n">Turn</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Harriman</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">10926</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">412950425</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">741077389</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">193</span><span class="o">-</span><span class="mi">199</span> <span class="n">Wawayanda</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Hewitt</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07421</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">412144655</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743949739</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">406</span><span class="o">-</span><span class="mi">496</span> <span class="n">Ward</span> <span class="n">Avenue</span><span class="p">,</span> <span class="n">Pine</span> <span class="n">Bush</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12566</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">415736605</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742847522</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">162</span> <span class="n">Merrill</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Highland</span> <span class="n">Mills</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">10930</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">413843930</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740501726</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="n">Clinton</span> <span class="n">Road</span><span class="p">,</span> <span class="n">West</span> <span class="n">Milford</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07480</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">410873075</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">744459023</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">16</span> <span class="n">Old</span> <span class="n">Brook</span> <span class="n">Lane</span><span class="p">,</span> <span class="n">Warwick</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">10990</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">412346009</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">744026814</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">3</span> <span class="n">Drake</span> <span class="n">Lane</span><span class="p">,</span> <span class="n">Pennington</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">08534</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">402948455</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">747903913</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">6324</span> <span class="mi">8</span><span class="n">th</span> <span class="n">Avenue</span><span class="p">,</span> <span class="n">Brooklyn</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">11220</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406337092</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740122226</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">1</span> <span class="n">Merck</span> <span class="n">Access</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Whitehouse</span> <span class="n">Station</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">08889</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406421967</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">747727624</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">78</span><span class="o">-</span><span class="mi">98</span> <span class="n">Schalck</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Narrowsburg</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12764</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">416318082</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">749677716</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">282</span> <span class="n">Lakeview</span> <span class="n">Drive</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Highland</span> <span class="n">Lake</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12743</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">415301720</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">748416257</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">330</span> <span class="n">Evelyn</span> <span class="n">Avenue</span><span class="p">,</span> <span class="n">Hamilton</span> <span class="n">Township</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">08619</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">402647019</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">747071791</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="n">New</span> <span class="n">York</span> <span class="n">State</span> <span class="n">Reference</span> <span class="n">Route</span> <span class="mi">987</span><span class="n">E</span><span class="p">,</span> <span class="n">Southfields</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">10975</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">412567807</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">741058078</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">103</span><span class="o">-</span><span class="mi">271</span> <span class="n">Tempaloni</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Ellenville</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12428</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">416855156</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">744420597</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">1300</span> <span class="n">Airport</span> <span class="n">Road</span><span class="p">,</span> <span class="n">North</span> <span class="n">Brunswick</span> <span class="n">Township</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">08902</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">404663628</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">744820157</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">407113723</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">749746483</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">402133926</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743613249</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">400273442</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">741220915</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">411236786</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">744070769</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">211</span><span class="o">-</span><span class="mi">225</span> <span class="n">Plains</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Augusta</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07822</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">411633782</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746784970</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">415830701</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742952812</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">165</span> <span class="n">Pedersen</span> <span class="n">Ridge</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Milford</span><span class="p">,</span> <span class="n">PA</span> <span class="mi">18337</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">413447164</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">748712898</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">100</span><span class="o">-</span><span class="mi">122</span> <span class="n">Locktown</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Frenchtown</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">08825</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">405047245</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">749800722</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">418858923</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746156790</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">650</span><span class="o">-</span><span class="mi">652</span> <span class="n">Willi</span> <span class="n">Hill</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Swan</span> <span class="n">Lake</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12783</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">417951888</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">748484944</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">26</span> <span class="n">East</span> <span class="mi">3</span><span class="n">rd</span> <span class="n">Street</span><span class="p">,</span> <span class="n">New</span> <span class="n">Providence</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07974</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">407033786</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743977337</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">417548014</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740075041</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">410395868</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">744972325</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">404615353</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">745129803</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">611</span> <span class="n">Lawrence</span> <span class="n">Avenue</span><span class="p">,</span> <span class="n">Westfield</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07090</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406589790</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743560121</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">18</span> <span class="n">Lannis</span> <span class="n">Avenue</span><span class="p">,</span> <span class="n">New</span> <span class="n">Windsor</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12553</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">414653148</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740477477</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">82</span><span class="o">-</span><span class="mi">104</span> <span class="n">Amherst</span> <span class="n">Avenue</span><span class="p">,</span> <span class="n">Colonia</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07067</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">405957808</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743255336</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">170</span> <span class="n">Seven</span> <span class="n">Lakes</span> <span class="n">Drive</span><span class="p">,</span> <span class="n">Sloatsburg</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">10974</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">411733589</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">741648093</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">1270</span> <span class="n">Lakes</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Monroe</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">10950</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">412676291</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742606606</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">509</span><span class="o">-</span><span class="mi">535</span> <span class="n">Alphano</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Great</span> <span class="n">Meadows</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07838</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">409224445</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">748286738</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">652</span> <span class="n">Garden</span> <span class="n">Street</span><span class="p">,</span> <span class="n">Elizabeth</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07202</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406523420</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742135517</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">349</span> <span class="n">Sea</span> <span class="n">Spray</span> <span class="n">Court</span><span class="p">,</span> <span class="n">Neptune</span> <span class="n">City</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07753</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">401827388</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740294537</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">13</span><span class="o">-</span><span class="mi">17</span> <span class="n">Stanley</span> <span class="n">Street</span><span class="p">,</span> <span class="n">West</span> <span class="n">Milford</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07480</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">410564152</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743685054</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">47</span> <span class="n">Industrial</span> <span class="n">Avenue</span><span class="p">,</span> <span class="n">Teterboro</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07608</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">408472324</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740726046</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">5</span> <span class="n">White</span> <span class="n">Oak</span> <span class="n">Lane</span><span class="p">,</span> <span class="n">Stony</span> <span class="n">Point</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">10980</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">412452168</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740214052</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="n">Berkshire</span> <span class="n">Valley</span> <span class="n">Management</span> <span class="n">Area</span> <span class="n">Trail</span><span class="p">,</span> <span class="n">Jefferson</span><span class="p">,</span> <span class="n">NJ</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">409146138</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746188906</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">1007</span> <span class="n">Jersey</span> <span class="n">Avenue</span><span class="p">,</span> <span class="n">New</span> <span class="n">Brunswick</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">08901</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">404701380</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">744781745</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">6</span> <span class="n">East</span> <span class="n">Emerald</span> <span class="n">Isle</span> <span class="n">Drive</span><span class="p">,</span> <span class="n">Lake</span> <span class="n">Hopatcong</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07849</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">409642566</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746017679</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">1358</span><span class="o">-</span><span class="mi">1474</span> <span class="n">New</span> <span class="n">Jersey</span> <span class="mi">57</span><span class="p">,</span> <span class="n">Port</span> <span class="n">Murray</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07865</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">408031728</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">748645385</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">367</span> <span class="n">Prospect</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Chester</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">10918</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">413700272</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742135189</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">10</span> <span class="n">Simon</span> <span class="n">Lake</span> <span class="n">Drive</span><span class="p">,</span> <span class="n">Atlantic</span> <span class="n">Highlands</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07716</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">404310607</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740282632</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">11</span> <span class="n">Ward</span> <span class="n">Street</span><span class="p">,</span> <span class="n">Mount</span> <span class="n">Arlington</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07856</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">409319800</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746201391</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">300</span><span class="o">-</span><span class="mi">398</span> <span class="n">Jefferson</span> <span class="n">Avenue</span><span class="p">,</span> <span class="n">Elizabeth</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07201</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406685311</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742108603</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">43</span> <span class="n">Dreher</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Roscoe</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12776</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">419018117</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">749142781</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="n">Swan</span> <span class="n">Street</span><span class="p">,</span> <span class="n">Pine</span> <span class="n">Island</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">10969</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">412856162</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">745148837</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">66</span> <span class="n">Pleasantview</span> <span class="n">Avenue</span><span class="p">,</span> <span class="n">Monticello</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12701</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">416560744</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746721964</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">405314270</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">749836354</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">414219548</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743327440</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">565</span> <span class="n">Winding</span> <span class="n">Hills</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Montgomery</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12549</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">415534177</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742900616</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">231</span> <span class="n">Rocky</span> <span class="n">Run</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Glen</span> <span class="n">Gardner</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">08826</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406898530</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">749127080</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">100</span> <span class="n">Mount</span> <span class="n">Pleasant</span> <span class="n">Avenue</span><span class="p">,</span> <span class="n">Newark</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07104</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">407586880</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">741670168</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">517</span><span class="o">-</span><span class="mi">521</span> <span class="n">Huntington</span> <span class="n">Drive</span><span class="p">,</span> <span class="n">Manchester</span> <span class="n">Township</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">08759</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">400106455</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742870190</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">400066188</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746793294</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">40</span> <span class="n">Mountain</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Napanoch</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12458</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">418803880</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">744102673</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">414204288</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">747895140</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">414777405</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740615601</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">48</span> <span class="n">North</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Forestburgh</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12777</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">415464475</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">747175374</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">404062378</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746376177</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">405688272</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">749285130</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">400342070</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">748788996</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">401809022</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">744157964</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">9</span> <span class="n">Thompson</span> <span class="n">Avenue</span><span class="p">,</span> <span class="n">Leonardo</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07737</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">404226644</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740517141</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">410322033</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">747871659</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">407100674</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">747742727</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">213</span> <span class="n">Bush</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Stone</span> <span class="n">Ridge</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12484</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">418811433</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">741718005</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">415034302</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743850945</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">411349992</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743694161</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">1</span><span class="o">-</span><span class="mi">17</span> <span class="n">Bergen</span> <span class="n">Court</span><span class="p">,</span> <span class="n">New</span> <span class="n">Brunswick</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">08901</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">404839914</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">744759616</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">35</span> <span class="n">Oakland</span> <span class="n">Valley</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Cuddebackville</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">12729</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">414638017</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">745957854</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">412127800</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740173578</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">401263460</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">747964303</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">412843391</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">749086026</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">418512773</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743067823</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">42</span><span class="o">-</span><span class="mi">102</span> <span class="n">Main</span> <span class="n">Street</span><span class="p">,</span> <span class="n">Belford</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07718</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">404318328</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740835638</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">419020746</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">741172328</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">404080723</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746119569</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">401012643</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">744035134</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">404306372</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">741079661</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">403966326</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">748519297</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">405002031</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">748407866</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">409532885</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742200683</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">416851321</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742674555</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">3387</span> <span class="n">Richmond</span> <span class="n">Terrace</span><span class="p">,</span> <span class="n">Staten</span> <span class="n">Island</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">10303</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406411633</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">741722051</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">261</span> <span class="n">Van</span> <span class="n">Sickle</span> <span class="n">Road</span><span class="p">,</span> <span class="n">Goshen</span><span class="p">,</span> <span class="n">NY</span> <span class="mi">10924</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">413069058</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">744597778</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">418465462</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746859398</span>

<span class="n">Feature</span> <span class="n">called</span>  <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">411733222</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">744228360</span>

<span class="n">Feature</span> <span class="n">called</span> <span class="mi">3</span> <span class="n">Hasta</span> <span class="n">Way</span><span class="p">,</span> <span class="n">Newton</span><span class="p">,</span> <span class="n">NJ</span> <span class="mi">07860</span><span class="p">,</span> <span class="n">USA</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">410248224</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">747127767</span>

<span class="o">--------------</span> <span class="n">RecordRoute</span> <span class="o">--------------</span>
<span class="n">Visiting</span> <span class="n">point</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">409642566</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746017679</span>

<span class="n">Visiting</span> <span class="n">point</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406109563</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742186778</span>

<span class="n">record</span> <span class="n">one</span> <span class="n">route</span> <span class="n">point</span><span class="p">:</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">409642566</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">746017679</span>

<span class="n">Visiting</span> <span class="n">point</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">404318328</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740835638</span>

<span class="n">record</span> <span class="n">one</span> <span class="n">route</span> <span class="n">point</span><span class="p">:</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406109563</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742186778</span>

<span class="n">Visiting</span> <span class="n">point</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">402133926</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743613249</span>

<span class="n">record</span> <span class="n">one</span> <span class="n">route</span> <span class="n">point</span><span class="p">:</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">404318328</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740835638</span>

<span class="n">Visiting</span> <span class="n">point</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406898530</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">749127080</span>

<span class="n">record</span> <span class="n">one</span> <span class="n">route</span> <span class="n">point</span><span class="p">:</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">402133926</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">743613249</span>

<span class="n">Visiting</span> <span class="n">point</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">401827388</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740294537</span>

<span class="n">record</span> <span class="n">one</span> <span class="n">route</span> <span class="n">point</span><span class="p">:</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406898530</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">749127080</span>

<span class="n">Visiting</span> <span class="n">point</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">413700272</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742135189</span>

<span class="n">record</span> <span class="n">one</span> <span class="n">route</span> <span class="n">point</span><span class="p">:</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">401827388</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">740294537</span>

<span class="n">record</span> <span class="n">one</span> <span class="n">route</span> <span class="n">point</span><span class="p">:</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">413700272</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">742135189</span>

<span class="n">Visiting</span> <span class="n">point</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406421967</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">747727624</span>

<span class="n">record</span> <span class="n">one</span> <span class="n">route</span> <span class="n">point</span><span class="p">:</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">406421967</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">747727624</span>

<span class="n">Visiting</span> <span class="n">point</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">415464475</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">747175374</span>

<span class="n">record</span> <span class="n">one</span> <span class="n">route</span> <span class="n">point</span><span class="p">:</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">415464475</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">747175374</span>

<span class="n">Visiting</span> <span class="n">point</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">400273442</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">741220915</span>

<span class="n">record</span> <span class="n">one</span> <span class="n">route</span> <span class="n">point</span><span class="p">:</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">400273442</span>
<span class="n">longitude</span><span class="p">:</span> <span class="o">-</span><span class="mi">741220915</span>

<span class="n">Finished</span> <span class="n">trip</span> <span class="k">with</span> <span class="mi">10</span> <span class="n">points</span> 
<span class="n">Passed</span> <span class="mi">10</span> <span class="n">features</span> 
<span class="n">Travelled</span> <span class="mi">775177</span> <span class="n">meters</span> 
<span class="n">It</span> <span class="n">took</span> <span class="mi">0</span> <span class="n">seconds</span> 
<span class="o">--------------</span> <span class="n">RouteChat</span> <span class="o">--------------</span>
<span class="n">Sending</span> <span class="n">First</span> <span class="n">message</span> <span class="n">at</span> 
<span class="n">Sending</span> <span class="n">Second</span> <span class="n">message</span> <span class="n">at</span> <span class="n">longitude</span><span class="p">:</span> <span class="mi">1</span>

<span class="n">Sending</span> <span class="n">Third</span> <span class="n">message</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">1</span>

<span class="n">Sending</span> <span class="n">Fourth</span> <span class="n">message</span> <span class="n">at</span> 
<span class="n">Sending</span> <span class="n">Fifth</span> <span class="n">message</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">1</span>

<span class="n">Received</span> <span class="n">message</span> <span class="n">First</span> <span class="n">message</span> <span class="n">at</span> 
<span class="n">Received</span> <span class="n">message</span> <span class="n">Third</span> <span class="n">message</span> <span class="n">at</span> <span class="n">latitude</span><span class="p">:</span> <span class="mi">1</span>

<span class="n">exit</span>
</pre></div>
</div>
</div>

<div id="outline-container-orgabee717" class="outline-2">
<h2 id="orgabee717">grpc stream 说明</h2>
<div class="outline-text-2" id="text-orgabee717">
<p>
grpc stream 概念和管道的概念很相似，grpc 输入的stream参数，相当于客户端链接服务端的一个管道，
返回的stream参数相当于服务端连接到客户端的管道。这样不管是客户端还是服务端在一次请求中，可以完全异步的进行通信。
</p>

<p>
在一次请求中， 对客户端来说，可以一边发送数据到服务端，同时也可以接受服务端的返回结果.
</p>
</div>
</div>
<div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">

<div class="footdef">
<sup><a id="fn.1" class="footnum" href="#fnr.1">1</a></sup><div class="footpara"><p class="footpara">
<a href="https://blog.netsil.com/http-2-and-grpc-the-next-generation-of-microservices-interactions-aff4ffa6faed">why grpc uses http2</a>
</p></div>
</div>


</div>
</div>
        </div>
                <ul class="pager hidden-print">
<li class="previous">
                <a href="../zi-jian-httpszhan-dian/" rel="prev" title="自建https站点">前一篇</a>
            </li>
        </ul>
<div id="disqus_thread"></div>
        <script>
        var disqus_shortname ="wisonwanghomepage",
            disqus_url="https://wisonwang.github.io/posts/python-grpc-shi-yong/",
        disqus_title="python grpc \u4f7f\u7528",
        disqus_identifier="cache/posts/python-grpc-shi-yong.html",
        disqus_config = function () {
            this.language = "zh_cn";
        };
        (function() {
            var dsq = document.createElement('script'); dsq.async = true;
            dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
    </script><noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a>
</noscript>
    <a href="https://disqus.com" class="dsq-brlink" rel="nofollow">Comments powered by <span class="logo-disqus">Disqus</span></a>


    </div>
                     <footer id="footer"><p>Contents © 2020         <a href="mailto:fangfu2012@gmail.com">vincent wang</a> - Powered by         <a href="https://getnikola.com" rel="nofollow">Nikola</a>         </p>
            
        </footer>
</div>
    </section><script src="../../assets/js/all-nocdn.js" type="text/javascript"></script><script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script><script type="text/x-mathjax-config">
    MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
    </script><script type="text/javascript">
            $(function(){
                $('.timeago').timeago();
            });
        </script>
</body>
</html>
